<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title>
<style> 
    #main
    {
        width:220px;
        height:300px;
        padding:1px;
        box-sizing:border-box;
        border:1px solid black;
        display:flex;
        flex-direction:column;
        justify-content:space_between;
        align-items:stretch;
    }

    div
    {
        box-sizing:border-box;
    }
    .d1{
        width:100%;
        height:40px;
        margin-bottom:20px;
        background-color:coral;
        flex-shrink:0;
    }
    .d2{
        height:100%;
        padding:5px;
        background-color:lightblue;
        opacity:0.8
    }
    .dd2{
        height:100%;
        background-color:#e1e1e1;
    }
</style>
</head>
<body>
    <div id="main">
      <div class="d1">顶部</div>
      <div class="d2">
        <div class="dd2"></div>    
      </div>
    </div>
</body>
</html>